package com.xinan.blog;

import java.util.List;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;

/**
 * Blog model.
 */
public class Blog extends Model<Blog> {
	public static final Blog dao = new Blog();
	
	public List<Blog> findAll() {
        return find("select * from blog order by id asc");
    }
	
    public String getName() {
        return get("name");
    }

    public String getComment() {
        return get("comment");
    }

    public Page<Blog> page(int pageNumber, int pageSize) {
        return paginate(pageNumber, pageSize, "select *", "from blog order by id asc");
    }
}